home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume12 / tek.p1 < prev    next >
Encoding:
Text File  |  1990-05-14  |  6.6 KB  |  269 lines

  1. Newsgroups: comp.sources.misc
  2. From: ron@mlfarm.UUCP (Ronald Florence)
  3. subject: v12i100: tek (patch 1)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 12, Issue 100
  7. Submitted-by: ron@mlfarm.UUCP (Ronald Florence)
  8. Archive-name: tek.p1
  9.  
  10. This patch enables tek (yet another tektronics 4014 emulator) to be
  11. used as a filter for stdin when the output device is the console, and
  12. permits command-line specification of the CGI font for Tektronics
  13. emulation.
  14. --
  15.  
  16. Ronald Florence            {yale,uunet}!hsi!mlfarm!ron
  17.  
  18.  
  19. #! /bin/sh
  20. # This is a shell archive, meaning:
  21. # 1. Remove everything above the #! /bin/sh line.
  22. # 2. Save the resulting text in a file.
  23. # 3. Execute the file with /bin/sh (not csh) to create:
  24. #    Readme.patch.1
  25. #    tek.patch.1
  26. # This archive created: Mon May 14 12:09:38 1990
  27. # By:    Ronald Florence (Maple Lawn Farm, Stonington, CT)
  28. export PATH; PATH=/bin:/usr/bin:$PATH
  29. echo shar: "extracting 'Readme.patch.1'" '(870 characters)'
  30. if test -f 'Readme.patch.1'
  31. then
  32.     echo shar: "will not over-write existing file 'Readme.patch.1'"
  33. else
  34. sed 's/^X//' << \SHAR_EOF > 'Readme.patch.1'
  35. XTek (patch 1, 5.14.90)
  36. X
  37. XThis patch fixes one bug and adds one feature to tek (yet another
  38. Xtektronics 4014 emulator).  CGI programs which take their input from
  39. Xstdin do not exit properly, and instead leave the console display in
  40. Xgraphics mode.  To make tek and poly usable as a filters, the code now
  41. Xrestores the previous text mode on exiting if the input is from stdin.
  42. XWith this patch, it is now possible to do
  43. X
  44. X    tek4014-program | tek [-wpaN]
  45. X            <or>
  46. X    graphics-in-ascii-points-program | poly [-spa]
  47. X
  48. Xand have the SCO multiscreen restored to text mode on the press of any
  49. Xkey.
  50. X
  51. XThe added feature is that the command line options now include -N,
  52. Xwhere N is a single digit from 1-9, used to specify the CGI graphics
  53. Xfont for tek.  With a VGA display, and with VERIFYFONT off, fonts 3 or
  54. X4 work well for Tektronics emulation.  
  55. X
  56. XRonald Florence
  57. X{yale,uunet}!hsi!mlfarm!ron
  58. SHAR_EOF
  59. if test 870 -ne "`wc -c < 'Readme.patch.1'`"
  60. then
  61.     echo shar: "error transmitting 'Readme.patch.1'" '(should have been 870 characters)'
  62. fi
  63. fi
  64. echo shar: "extracting 'tek.patch.1'" '(4024 characters)'
  65. if test -f 'tek.patch.1'
  66. then
  67.     echo shar: "will not over-write existing file 'tek.patch.1'"
  68. else
  69. sed 's/^X//' << \SHAR_EOF > 'tek.patch.1'
  70. X*** tek.c.orig    Sun Mar 18 19:44:13 1990
  71. X--- tek.c    Fri May 11 12:10:40 1990
  72. X***************
  73. X*** 1,6 ****
  74. X--- 1,7 ----
  75. X  /*
  76. X   *  tek.c  
  77. X   *  copyright 1988 Ronald Florence
  78. X+  *  5.12.90 fixed to restore mode when source is stdin
  79. X   *
  80. X   *    as "tek" - Tek4014 picture files to CGI or WY99
  81. X   *      -w  Accu-Weather maps
  82. X***************
  83. X*** 10,20 ****
  84. X   *    both:
  85. X   *      -p  use plotter or printer (default display)
  86. X   *      -a  preserve aspect ratio
  87. X!  *
  88. X!  *    bugs: SIGINT doesn't work with wy99 modes.  Possible solution is to
  89. X!  *    poll terminal on every iteration, with terminal set in raw mode.
  90. X   */
  91. X  
  92. X  #include  <signal.h>
  93. X  #include  <stdio.h>
  94. X  #include  <termio.h>
  95. X--- 11,20 ----
  96. X   *    both:
  97. X   *      -p  use plotter or printer (default display)
  98. X   *      -a  preserve aspect ratio
  99. X!  *    -N  N is a single digit: use CGI font #N
  100. X   */
  101. X  
  102. X+ #include  <sys/machdep.h>
  103. X  #include  <signal.h>
  104. X  #include  <stdio.h>
  105. X  #include  <termio.h>
  106. X***************
  107. X*** 22,27 ****
  108. X--- 22,28 ----
  109. X  
  110. X  #define  int        short        /* for CGI functions    */
  111. X  #define     CRT        (wout[45] == 0)
  112. X+ #define  CGI_FONTS    wout[10]
  113. X  #define     To_tek        "\033[?38h"
  114. X  #define     To_vt220    "\033[?38l"
  115. X  #define     Clr_tek    "\033\f"
  116. X***************
  117. X*** 28,35 ****
  118. X  #define  Vt_reset    "\033!p"
  119. X  
  120. X  int    dev;            /* device id */
  121. X! static  int    tty;
  122. X  struct  termio new, old;
  123. X  static  int  tek;        /* =1 if invoked as tek */
  124. X  static  char  *progn;
  125. X  static  char  *dspec[] = {"CGIDISP", "CGIPRNT", 0 };
  126. X--- 29,37 ----
  127. X  #define  Vt_reset    "\033!p"
  128. X  
  129. X  int    dev;            /* device id */
  130. X! static  int  tty;
  131. X  struct  termio new, old;
  132. X+ static  int  mode;        /* video mode to reset */
  133. X  static  int  tek;        /* =1 if invoked as tek */
  134. X  static  char  *progn;
  135. X  static  char  *dspec[] = {"CGIDISP", "CGIPRNT", 0 };
  136. X***************
  137. X*** 44,49 ****
  138. X--- 46,52 ----
  139. X          h = 0, 
  140. X      aspect = 0,        /* map to max CGI space */
  141. X      opt = 0,
  142. X+     font = 0,
  143. X      sig_handle(), quit_wyse();
  144. X      char    *device, *p, *getenv(), *strrchr(); 
  145. X  
  146. X***************
  147. X*** 74,79 ****
  148. X--- 77,93 ----
  149. X      case 'a' :
  150. X        aspect = 3;
  151. X        break;
  152. X+     case '1':
  153. X+     case '2':
  154. X+     case '3':
  155. X+     case '4':
  156. X+     case '5':
  157. X+     case '6':
  158. X+     case '7':
  159. X+     case '8':
  160. X+     case '9':
  161. X+       font = *p - '0';
  162. X+       break;
  163. X      default :
  164. X        usage();
  165. X      }
  166. X***************
  167. X*** 89,94 ****
  168. X--- 103,111 ----
  169. X    tty = open("/dev/tty", O_RDWR);
  170. X    ioctl(tty, TCGETA, &new);
  171. X    ioctl(tty, TCGETA, &old);
  172. X+                 /* get the current video mode */
  173. X+   mode = ioctl(tty, CONS_GET, 0);
  174. X+ 
  175. X                  /* wyse 99 terminal? */
  176. X    if (!h && !strncmp(getenv("TERM"), "wy99", 4))
  177. X      {
  178. X***************
  179. X*** 134,139 ****
  180. X--- 151,159 ----
  181. X        printf("%s: error %d opening %s\n", progn, -vq_error(), device);
  182. X        exit (-1);
  183. X      }    
  184. X+   if (font > 0 && font <= CGI_FONTS)
  185. X+     vst_font(dev, font);
  186. X+ 
  187. X    if (tek)
  188. X      tekdecode(fi, opt);
  189. X    else
  190. X***************
  191. X*** 141,152 ****
  192. X    if (CRT)  
  193. X      getkey();
  194. X    v_clswk(dev);
  195. X  }
  196. X  
  197. X  
  198. X  usage ()
  199. X  {
  200. X!   printf("usage: %s file\n", tek ? "tek [-wpa]" : "poly [-spa]");
  201. X    exit (-1);
  202. X  }
  203. X  
  204. X--- 161,174 ----
  205. X    if (CRT)  
  206. X      getkey();
  207. X    v_clswk(dev);
  208. X+   if (CRT && fi == stdin)
  209. X+     ioctl(tty, (MODESWITCH | mode), 0);
  210. X  }
  211. X  
  212. X  
  213. X  usage ()
  214. X  {
  215. X!   printf("usage: %s [-N] file\n", tek ? "tek [-wpa]" : "poly [-spa]");
  216. X    exit (-1);
  217. X  }
  218. X  
  219. X*** tek.man.orig    Fri May 11 12:58:44 1990
  220. X--- tek.man    Fri May 11 13:02:22 1990
  221. X***************
  222. X*** 8,13 ****
  223. X--- 8,15 ----
  224. X  [
  225. X  .I -wap
  226. X  ] [
  227. X+ .I -N
  228. X+ ] [
  229. X  .I file
  230. X  ]
  231. X  .br
  232. X***************
  233. X*** 15,20 ****
  234. X--- 17,24 ----
  235. X  [
  236. X  .I -sap
  237. X  ] [
  238. X+ .I -N
  239. X+ ] [
  240. X  .I file
  241. X  ]
  242. X  .SH DESCRIPTION
  243. X***************
  244. X*** 60,65 ****
  245. X--- 64,77 ----
  246. X  be specified by declaring a (non-null)
  247. X  .SM ASPECT 
  248. X  environment variable.  
  249. X+ .PP
  250. X+ The 
  251. X+ .I -N
  252. X+ option, where 
  253. X+ .I N 
  254. X+ is a digit from 1 to 9, is used to specify the CGI graphics font used by
  255. X+ .I tek.
  256. X+ The fonts are system and device dependent.
  257. X  .SH BUGS
  258. X  The available type sizes on CGI output devices may not match the
  259. X  Tektronics display.  The interactive Tektronics input functions are
  260. SHAR_EOF
  261. if test 4024 -ne "`wc -c < 'tek.patch.1'`"
  262. then
  263.     echo shar: "error transmitting 'tek.patch.1'" '(should have been 4024 characters)'
  264. fi
  265. fi
  266. exit 0
  267. #    End of shell archive
  268.  
  269.